<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <title>个人中心</title>
  <link rel="stylesheet" href="mobile/layui/css/layui.mobile.css">
  <link rel="stylesheet" href="mobile/layui/css/layui.css">
  <link rel="stylesheet" href="mobile/css/yj_css.css">

</head>
<body>
  <header class="yj-header">
    <a class="yj-header-return layui-icon"></a>
    <span>个人中心</span>
    <a class="yj-header-meau"></a>
  </header>
  <footer class="yj-footer">
    <a class="yj-footer-item" href="carIndex">
      <span class="yj-footer-icon"><img src="mobile/images/home1.png"></span>
      <p class="yj-footer-title">首页</p>
    </a>
     <a class="yj-footer-item yj-footer-middle">
      <span class="yj-footer-icon"><img src="mobile/images/user2.png"></span>
      <p class="yj-footer-title yj-color-main">会员中心</p>
    </a>
     <a class="yj-footer-item" href="order.html">
      <span class="yj-footer-icon"><img src="mobile/images/printer1.png"></span>
      <p class="yj-footer-title">订单详情</p>
    </a>
  </footer>

  <div class="yj-content">
    <div class="yj-user-header">
      <a class="yj-user-set" href="set.html"><i class="layui-icon">&#xe614;</i></a>
      <img class="yj-user-photo" src="mobile/images/head.jpeg" onclick="login_popup()">
      <p class="yj-user-name" onclick="authentication()" th:unless="${session.currentUser.userInfo.uName}" th:text="请上传认证信息"></p>
      <p class="yj-user-name"  th:if="${session.currentUser.userInfo.uName}" th:text="${session.currentUser.userInfo.uName}"></p>
    </div>

    <div class="yj-mar-t yj-bgfff">
      <p class="yj-list-item yj-pad-lr-big yj-border-b"><a class="yj-block" href="order_confirm.html">
        <img class="yj-list-item-icon" src="mobile/images/order.png">订单<span class="yj-right layui-icon yj-color-gray-light">&#xe602;</span>
      </a></p>

      <ul class="yj-user-row">
        <li class="yj-user-row-item"><a href="order.html">
          <span class="yj-user-row-icon yj-mar-r yj-message">
            <img src="mobile/images/pay_wait.png" width="100%" height="100%">
            <span class="yj-message-num" id="countPaying">0</span>
          </span>
          待付款
        </a></li>
        <li class="yj-user-row-item"><a href="order.html">
          <span class="yj-user-row-icon yj-mar-r yj-message">
            <img src="mobile/images/treat_wait.png" width="100%" height="100%">
            <span class="yj-message-num" id="countSuccess">0</span>
          </span>
          已完成
        </a></li>
      </ul>
    </div>
    <div class="yj-mar-t yj-bgfff">
      <ul class="yj-list yj-pad-lr-big">
        <li class="yj-list-item" id="invesetMoney">
            <img class="yj-list-item-icon" src="mobile/images/tb4.png" >余额充值
            <span class="yj-right yj-color-gray-light">
              <font class="yj-color-red"><span id="uMoney"></span>￥</font>
              <i class="layui-icon yj-mar-l">&#xe602;</i>
            </span>
          </a>
        </li>
        <li class="yj-list-item">
          <a class="yj-block" th:href="@{|/indentForm/findIndentForm|}">
            <img class="yj-list-item-icon" src="mobile/images/tb5.png">余额明细
            <i class="layui-icon yj-right yj-color-gray-light">&#xe602;</i>
          </a>
        </li>
        <li class="yj-list-item">
          <a class="yj-block" href="shares.html">
            <img class="yj-list-item-icon" src="mobile/images/tb6.png">代金券
            <i class="layui-icon yj-right yj-color-gray-light">&#xe602;</i>
          </a>
        </li>
        <li class="yj-list-item">
          <a class="yj-block" href="javascript:void(0)" onclick="share()">
            <img class="yj-list-item-icon" src="mobile/images/tb7.png">分享给好友
            <span class="yj-right yj-color-gray-light">
            分享领红包
              <i class="layui-icon yj-right yj-color-gray-light">&#xe602;</i></span>
          </a>
        </li>
        <li class="yj-list-item">
          <a class="yj-block" href="workOrder_list.html">
            <img class="yj-list-item-icon" src="mobile/images/order.png">我的工单
            <i class="layui-icon yj-right yj-color-gray-light">&#xe602;</i>
          </a>
        </li>
      </ul>
    </div>
  </div>
  <script th:src="@{/mobile/js/jquery.min.js}"></script>
  <script th:src="@{/mobile/layui/layui.js}"></script>
  <script th:src="@{/mobile/layer/mobile/layer.js}"></script>
  <script th:inline="javascript">
        var url = [[@{/}]];
        var shareUrl = "";

          function authentication() {
            window.location.href = "user/authentication";
          }

          $.ajax({
            url: url + "userInfo/share",
            success:function (result) {
              shareUrl =  result.result.link;
            }
          });
  </script>
  <script type="text/javascript">

    $(function(){
        $.ajax({
           url:url+"userInfo/activeUserInfo",
           type:"get",
           success:function (result) {
              $("#uMoney").html(result.uMoney);
           }
        })

      $("#invesetMoney").click(function () {
        location.href = url+"recharge.html";
      })
    })

    $.ajax({
      url:url+"orderForm/payIng",
      success:function (result) {
        if (result.result != null){
          $("#countPaying").html(1);
        }
      }
    })

    $.ajax({
      url:url+"orderForm/countSuccessOrder",
      success:function (result) {
        if (result != 0){
          $("#countSuccess").html(result);
        }
      }
    })
  function share() {

    layer.open({
      type:1,
      title: [
        '分享到',
        'background-color: #393D49; color:#fff;'
      ]
      ,content: '<div >\n' +
              '            <a href="http://connect.qq.com/widget/shareqq/index.html?url=' + shareUrl + '">\n' +
              '                <img src="mobile/images/qq.png" alt=""/>\n' +
              '            </a>\n' +
              '            <a href="http://zixuephp.net/inc/qrcode_img.php?url=' + shareUrl + '">\n' +
              '                <img src="mobile/images/wx.png" alt=""/>\n' +
              '            </a>\n' +
              '            <a href="http://service.weibo.com/share/share.php?url=' + shareUrl + '">\n' +
              '                <img src="mobile/images/wb.png" alt=""/>\n' +
              '            </a>\n' +
              '        </div>'
      ,skin: 'footer'
    });
  }
  </script>
</body>
</html>